<script src="<?php echo base_url();?>public/admin/js/check_form.js"></script>
<script>
	function ValidationForm(){
		x = check_null('name');
		if(x==true){return true;}
		else{return false;}		
	}
</script>
<div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"><?php echo $title;?></h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <?php echo $title_table;?>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <form action="" method="post" onsubmit="return ValidationForm();">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <?php foreach($data as $row){ ?>
                                    <tr>
                                        <td><label>Tiêu đề</label></td>
                                        <td>
                                        	<input type="text" name="name" size="50" value="<?php echo $row['name']; ?>" />
                                        	<label class="name">(*)</label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><label>Danh mục cha</label></td>
                                        <td>
                                        	<select name="parent_id">
                                                <option value="0" > --- Chọn danh mục --- </option>
                                                <?php echo $category; ?>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><label>Thứ tự</label></td>
                                        <td>
                                        	<input type="text" name="order" size="5" value="<?php echo $row['order'];?>" />
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td><label>Trạng thái</label></td>
                                        <td>
                                        	<input type="checkbox" name="status" value="<?php echo $row['status']; ?>" <?php if($row['status']==1){?>checked="checked" <?php }?> />
                                        </td>
                                    </tr>                                                              
                                    <input type="hidden" name="id" value="<?php echo $row['id']; ?>" />
                                    <?php }?>                               
                                    <tr>
                                    	<td></td>
                                        <td colspan="2">
                                        	<input type="submit" name="submit"  value="Hoàn tất"/>
                                        </td>
                                    </tr>                                                                                                    
                                </table>
                                </form>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
                
</div>
<!-- /#page-wrapper -->

